<!doctype html>
<html lang="en">
<head>
    <%- include common/headMeta %>
    <title>Document</title>
    <%- include common/headLink %>
    <style>
        .child{
            display: none;
        }
    </style>
</head>
<body>
<div>hello world</div>

<input type="text" name="name" id="parent"/>
<a href="javascript:;" id="submit">提交</a>
<div class="child"><%= newdata %></div>
<script>
    KISSY.use('dom, node, event ,io' , function (S, DOM, Node, Event, IO) {
        var $ = S.all,
                _event = S.Event;
        _event.on('#submit', 'click', function () {

            var parent = $('#parent').val(),
                    child = $('.child');

            new IO({
                type: 'post',
                url: '/demo',
                data: {
                    name: parent
                },
                success: function () {
                    child.css('display', 'block');
                },
                error: function () {
                    console.log('1');
                }
            });
        })

    })
</script>
</body>
</html>